<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<<<<<<< HEAD
    <script src="./继承.js"></script>
    <title>index</title>
  </head>
  <body>
    <script></script>
=======
    <!-- <script src="./new实现原理.js"></script> -->
    <title>index</title>
  </head>
  <body>
    <script>
      function deepClone(origin) {
        let target =
          Object.prototype.toString.call(origin) === "[object,Array]" ? [] : {};
        for (const key in origin) {
          if (Object.hasOwnProperty.call(origin, key)) {
            if (typeof origin[key] != "object") {
              target[key] = origin[key];
            } else {
              target[key] = deepClone(origin[key]);
            }
          }
        }
        return target;
      }
      let obj1 = { name: "hy", age: 18 };
      let obj2 = deepClone(obj1);
      obj1.sex = "man";
      console.log(obj1, obj2);
    </script>
>>>>>>> d1ed2b3ef50c767f0b5ea66f44222d12a71136a2
  </body>
</html>
